<template>
      <my-el-menu
        :defaultActive = "defaultActive"
        :isCollapse="getIsCollapse"
        :datas="datas"></my-el-menu>
</template>

<script type="text/ecmascript-6">
import myElMenu from '@/UIcomponents/myElementUI/myElMenu/MyElmenu';
import { mapGetters, mapActions } from 'Vuex';
export default {
  name: 'LeftMenu',
  components: {myElMenu},
  props: {},
  data() {
    return {
      defaultActive: '', // 默认展开的项
      datas: [], // 列表的数据
      configMap: {},
      isCollapse: false
    };
  },
  methods: {
  },
  watch: {
    $route(newV) {
      this.defaultActive = newV.path;
    }
  },
  computed: {
    ...mapGetters(['getIsCollapse'])
  },
  mounted() {
    _https.get.getLeftMenu().then(res => {
      this.datas = res.data.datas;
      // 设置默认展开的项
      this.defaultActive = this.$route.path;
    });
  },
  destroyed() {
  }
};
</script>
<style scoped lang="less">
</style>
